<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link rel="stylesheet"
	href="${webroot}/resource/bootstrap/bootstrap.min.css" />
<script src='${webroot}/resource/bootstrap/jquery-2.0.3.min.js'></script>
<%@ include file="/WEB-INF/views/common.jsp"%>
<script src='${webroot}/resource/highchart/highcharts.js'></script>
<script src='${webroot}/resource/highchart/highcharts-3d.js'></script>
<script src='${webroot}/resource/highchart/modules/exporting.js'></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	$(function() {
		$("#start").on('click', function() {
			$.ajax({
				url : "/exam/startExam.do",
				type : "get",
				success : function(data) {
					location.reload();
				}
			})
		});

		$("#end").on('click', function() {
			$.ajax({
				url : "/exam/endExam.do",
				type : "get",
				success : function(data) {
					location.reload();
				}
			})
		});

		$("#f5").on('click', function() {
			location.reload();
		});
		
		$("#pie").on('click', function() {
			$("#pieDialog").dialog('open').dialog('setTitle', '合格率');
		});
		$('#container').highcharts({
			chart : {
				type : 'pie',
				options3d : {
					enabled : true,
					alpha : 45,
					beta : 0
				}
			},
			title : {
				text : '各状态考生百分比'
			},
			tooltip : {
				pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
			},
			exporting : {
				enabled : false
			},
			credits : {
				enabled : false
			},
			plotOptions : {
				pie : {
					allowPointSelect : true,
					cursor : 'pointer',
					depth : 35,
					dataLabels : {
						enabled : true,
						format : '{point.name}'
					}
				}
			}
		});
	})
</script>
</head>
<body>
	<div class="main-content">

		<div class="page-content">
			<div class="page-header">
				<h3>
					<a href="">&nbsp;主页>当前考试</a>
					<lgall> <i class="icon-double-angle-right"></i> </lgall>
				</h3>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<form action="" id="">
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-9">
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">考试名称：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;">${CURRENT_EXAM_SESSION.examName}</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">考试状态：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;"> <c:if
												test="${CURRENT_EXAM_SESSION.examState ==0}">
												未开考
											</c:if> <c:if test="${CURRENT_EXAM_SESSION.examState ==1}">
												正在考试...
											</c:if>
										</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">考试总时间：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;">${CURRENT_EXAM_SESSION.examTime}&nbsp;分钟</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">试题类型：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;">${CURRENT_EXAM_SESSION.radioScore}*${CURRENT_EXAM_SESSION.radioNum}(单选)+${CURRENT_EXAM_SESSION.checkScore}*${CURRENT_EXAM_SESSION.checkNum}(多选)+${CURRENT_EXAM_SESSION.judgeScore}*${CURRENT_EXAM_SESSION.judgeNum}(判断)</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">当前有考生：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;"><font
											color="#FF0000">${CURRENT_EXAM_SESSION.studentTotal}</font>&nbsp;&nbsp;人</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<h4>
										<label class="col-lg-2 control-label no-padding-right"
											for="form-field-1">当前有试题：</label>
									</h4>
									<h4>
										<label class="col-lg-5 control-label no-padding-right"
											for="form-field-1" style="margin-left: -50px;"><font
											color="#FF0000">${CURRENT_EXAM_SESSION.radioTotal}</font>&nbsp;道单选，<font
											color="#FF0000">${CURRENT_EXAM_SESSION.checkTotal}</font>&nbsp;道多选，<font
											color="#FF0000">${CURRENT_EXAM_SESSION.judgeTotal}</font>&nbsp;道判断</label>
									</h4>
								</div>
								<br /> <br />
								<div class="form-group">
									<table>
										<tr>
											<td width="130px;">
												<h4>
													<label class="col-lg-2 control-label no-padding-right"
														for="form-field-1" style="width: 130px;">合格率：</label>
												</h4>
											</td>
											<td>
												<h4>
													<label class="col-lg-5 control-label no-padding-right"
														for="form-field-1" style="margin-left: -50px;"><font
														color="#FF0000">${CURRENT_EXAM_SESSION.pass}</font></label>
												</h4>
											</td>
										</tr>
									</table>
									<br>
									<c:if test="${CURRENT_EXAM_SESSION.examState==0}">
										<button class="btn btn-info" id="start"
											style="margin-left: 20px;">开始考试</button>
									</c:if>
									<button class="btn btn-info" id="f5" style="margin-left: 20px;">
										刷新</button>
									<c:if test="${CURRENT_EXAM_SESSION.examState==1}">
										<button class="btn btn-info" id="end"
											style="margin-left: 20px;">结束考试</button>
									</c:if>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div id="pieDialog" class="easyui-dialog"
		style="width: 638px; height: 450px; padding: 10px 20px" closed="true">
		<div id="container" style="height: 355px;"></div>
	</div>
</body>
</html>